import { createStore } from 'vuex'
import createPersistedState from 'vuex-persistedstate'

export default createStore({
  state: {
    token:0,
      atid:0,
      adid:0,
    attcity:"",
    attractions:[],
      attraction:[],
    orderapply:{//定义全局变量 记录预约的订单对象

    },
    orderpre:{//记录订单预览页的对象数据

    },
    chater:{

    }
  },
  mutations: {
    setToken(state,t){
      state.token=t;
    }
    ,
    setApply(state,a){
      state.orderapply=a;
    },
    setOrderpre(state,o){
      state.orderpre=o;
    },setchater(state,c){
      state.chater=c;
    },
      setAtid(state,at){
          state.atid=at;
      }, setAdid(state,ad){
          state.adid=ad;
      },setAttCity(state,city){
      state.attcity=city;
    },
      setattractions(state,a){
          state.attractions=a;
      },setattraction(state,a){
          state.attraction=a;
      }
    },

  plugins: [createPersistedState()]
})
